//
//  BuildingMgmtViewController.h
//  FMS
//
//  Created by Steven on 10/12/13.
//  Copyright (c) 2013 QGSVN. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "FilterViewController.h"
#import "UIMySearchBar.h"

@interface BuildingMgmtViewController : UIViewController <FilterViewDelegate,UITableViewDataSource,UITableViewDelegate,UISearchBarDelegate>{
    NSDictionary *dictLanguage;
    UIPopoverController *popoverController;
    NSMutableArray *mainArray;
    int itemType; //Building or Facility
    NSMutableDictionary *filterDictValue;
    
    NSString *buildingId;
    NSString *serviceId;
    NSString *campId;
    NSString *unitId;
    NSString *floorId;
    NSString *systemId;
    NSString *descriptionId;
    
    int currentRecordIndex;
    BOOL isLoadMore;
    BOOL didReadyLoadMore;
    BOOL isLock;
    BOOL isSearching;
    
    UIActivityIndicatorView *myActivityView;
    UIButton *btnCurtain;
    
    NSMutableArray *searchArray;
    NSMutableArray *originalArray;
}

@property (weak, nonatomic) IBOutlet UIView *viewFilterItem;
@property (weak, nonatomic) IBOutlet UIButton *btnCategoryProgram;
@property (weak, nonatomic) IBOutlet UIButton *btnWorkType;
@property (unsafe_unretained) id parent;
@property (strong, nonatomic) IBOutlet UITableView *mainTableView;
@property (strong, nonatomic) IBOutlet UIButton *btnSelectBuilding;
@property (strong, nonatomic) IBOutlet UIButton *btnSelectFloor;
@property (strong, nonatomic) IBOutlet UIButton *btnSelectRoom;
@property (strong, nonatomic) IBOutlet UIButton *btnSelectUnit;
@property (strong, nonatomic) IBOutlet UIButton *btnSelectCamp;
@property (strong, nonatomic) IBOutlet UIButton *btnSelectService;
@property (strong, nonatomic) IBOutlet UIButton *btnSelectSystem;
@property (strong, nonatomic) IBOutlet UIButton *btnSelectDescription;
@property (strong, nonatomic) IBOutlet UIButton *btnSelectItemType;
@property (strong, nonatomic) IBOutlet UIButton *btnSelectLocation;

@property (strong, nonatomic) IBOutlet UILabel *lbMainTitle;
@property (strong, nonatomic) IBOutlet UILabel *lbItemID;
@property (strong, nonatomic) IBOutlet UILabel *lbRoom;
@property (strong, nonatomic) IBOutlet UILabel *lbFloor;
@property (strong, nonatomic) IBOutlet UILabel *lbBuilding;

@property (strong, nonatomic) IBOutlet UIButton *btnBack;
@property (strong, nonatomic) IBOutlet UIButton *btnAddNew;

@property (assign,readwrite) int serviceType;
@property (assign,readwrite) int maintenanceType;

@property (strong, nonatomic) IBOutlet UIMySearchBar *mySearchBar;
@property (strong, nonatomic) IBOutlet UILabel *lbChooseItem;

@property (strong, nonatomic) IBOutlet UIView *leftBackground;
@property (strong, nonatomic) IBOutlet UILabel *lbShowItem;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil itemType:(int)_itemType;
- (IBAction)addNewItem:(id)sender;

- (IBAction) backPreviousView:(id)sender;
- (IBAction) selectFilter:(UIButton*)sender;

- (IBAction)selectCategoryProgram:(id)sender;
- (IBAction)selectWorkType:(id)sender;
- (void) confirmSelectMaintenance:(NSMutableDictionary*)_dict itemDetailedDict:(NSMutableDictionary*)_itemDetailedDict;
- (void) listRoom;
- (void) listEquipment;
- (void) reloadAfterUpdate:(NSMutableDictionary*)_dict;

@end
